function LeftRotateString(str, n)
{
    // write code here
   if(str === null) return ''
   let m = str.length
   let arr = str.split('')
   n = n % m
   function reverse(l,r){
     while(l < r){
       let temp = arr[l]
       arr[l] = arr[r]
       arr[r] = temp
       l++
       r--
     }
   }
   reverse(0,m-1)
   reverse(0,m-n-1)
   reverse(m-n,m-1)
   return arr.join('')
}
module.exports = {
    LeftRotateString : LeftRotateString
};